import { get, post } from '../ajax'

import { getAjaxBaseUrl } from '../handler'
import type { AjaxPagingResult } from '@/types'

const controller = getAjaxBaseUrl(
  '/warningHistory',
  '/energy',
)

/** 预警信息历史记录查询 */
export function getEarlyWarningHistoryList(option: Partial<{
  pageNumber: number
  pageSize: number
  earlyWarningType: string
  earlyWarningLevel: string
  measuringToolId: string
  indicatorType: string
}>) {
  return post<AjaxPagingResult>(
    `${controller}/getEarlyWarningHistoryList`,
    option,
  )
}

/** 预警分组统计 */
export function warningHistoryStatic() {
  return get(`${controller}/warningHistoryStatic`)
}
